import React from 'react';
import ReactDOM from 'react-dom';
import { inject, observer } from 'mobx-react';
import { WeaDialog, WeaBrowser, WeaLocaleProvider } from 'ecCom';
import { Button } from 'antd';

const getLabel = WeaLocaleProvider.getLabel;

@inject('netDiskStore')
@observer
class MoveDialog extends React.Component {
   constructor(props) {
      super(props);
      this.buttons = [
         <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3tmyu7@submit`} type="primary">确认</Button>,
         <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@60sgni@cancel`} type="ghost">取消</Button>,
      ];
   }
   componentDidMount() {
      const { setMoveFilesData } = this.props.netDiskStore;
      setMoveFilesData({ ref: this.BrowserRef });
   }

   browserChange = (ids, names, datas) => {
      console.log('单选', this.BrowserRef, ids, names, datas);
   };


   render() {
      return (
            <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@txg1s7`}
              customized={true}
              ref={(e) => {
 this.BrowserRef = e; 
}}
               // title={ getLabel(19214, '选择目录') }
               // hasRadio={true}
              type={4}
              tabs={[
                  {
                     isSearch: false,
                     key: '2',
                     name: '组织结构',
                     selected: false,
                     showOrder: 0,
                  },
                  {
                     dataParams: { list: '1' },
                     isSearch: true,
                     key: '1',
                     name: '按列表',
                     selected: false,
                     showOrder: 0,
                  },
               ]}
               // buttons={this.buttons}

               // linkUrl="/workflow/request/ViewRequestForwardSPA.jsp?isrequest=1&authStr=&authSignatureStr=&fieldid=172&requestid="
               // tabs={[
               //    {
               //      isSearch: false,
               //      key: "1",
               //      name: "列表展示",
               //      selected: false
               //    },
               //    {
               //      isSearch: false,
               //      key: "2",
               //      name: "树形展示",
               //      selected: false,
               //      dataParams: {  // tab请求数据需要带的参数
               //        collReq: "1"
               //      }
               //    }
               // ]}
               // hasAdvanceSerach={true}
              icon={'icon-toolbar-Organization-list'}
              iconBgcolor={'#b32e37'}
               // isSingle={false}
              onChange={this.browserChange}
            />
      );
   }
}

export default MoveDialog;

